package com.gxa.controller.HospitalController;


import com.gxa.service.IntroductionService;
import com.gxa.utils.R;
import com.gxa.vo.DoctorVo;
import com.gxa.vo.IntroductionVo;
import io.swagger.annotations.*;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@Api(tags="医院简介接口")
@RestController
public class IntroductionController {

    @Autowired
    private IntroductionService introductionService;

    @ApiOperation(value="修改接口",notes="方法的详细描述",produces = "application/json",response = R.class)
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "Authorization", value = "令牌", paramType = "header",dataType ="String" ,required = true)
    })
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "返回查询详细信息",examples = @Example(
                    value = {
                            @ExampleProperty(value = "{'code':200,'msg':'描述'}}", mediaType = "application/json")
                    })),
            @ApiResponse(code = 306, message = "登录已超时，请重新登录"),
            @ApiResponse(code = 307, message = "令牌格式不正确"),
            @ApiResponse(code = 401, message = "没有权限"),
            @ApiResponse(code = 400, message = "请求错误"),
            @ApiResponse(code = 403, message = "无效请求，本系统只支持AJAX请求"),
            @ApiResponse(code = 500, message = "服务器内部错误")
    })
    @RequiresPermissions("hos:update")
    @PutMapping("/doc/EditIntroduction")
    public R EditIntroduction(@ApiParam(name="修改后的数据",value = "根据修改后的数据修改",required = true)@RequestBody IntroductionVo introductionVo){
        System.out.println(introductionVo);
        this.introductionService.updateText(introductionVo.getText());
        return R.ok();

    }


}
